<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>对象运算符</title>
</head>
<body>
    <h1>对象运算符</h1>
    <h2>扩展运算符(...)用于取出参数对象的所有可遍历属性，拷贝到当前对象之中</h2>
    <h2>深拷贝和浅拷贝的区别</h2>

    <script>
        let obj = { a: { b: 1 } };
        let x = JSON.parse(JSON.stringify(obj));  // 深拷贝
        obj.a.b = 2;
        console.log(x.a.b);  // 输出 1，不受原对象修改的影响
    </script>
</body>
</html>
